<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.js"></script>
</head>

<body>
    <div style="width: 100%;height:800px" id="main"></div>
</body>

</html>
<script>
    let main = document.querySelector('#main')
    let obj = echarts.init(main)
    let option = {
        xAxis: {
            // 类目轴
            type: 'category',
            data: ['美食', '数码', '日化', '蔬菜', '熟食']
        },
        yAxis: {
            // 数值轴
            type: 'value'
        },
        // 图例
        legend: {},

        grid: {

            show: true,

            borderColor: 'pink',
            backgroundColor: 'red',
        },
        series: [
            {
                // 柱状图
                type: 'bar',
                name: '销量',
                data: [88, 75, 20, 210, 35]
            }
        ]
    }
    obj.setOption(option)
</script>